package com.quad.innovators.salesease.common.result;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

@Getter
@Setter
public class PageResultBean<T> {

    @Schema(description = "数据总条数")
    private PageInfo pageInfo;
    @Schema(description = "当前页数据集合")
    private List<T> items;

    public PageResultBean() {
    }

    public PageResultBean(PageInfo pageInfo, List<T> items) {
        this.pageInfo = pageInfo;
        this.items = items;
    }

    public static <E> PageResultBean<E> getInstance(PageInfo pageInfo, List<E> items) {
        return new PageResultBean<>(pageInfo, items);
    }
}
